package com.menggudf.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="illness")
public class Illness implements Serializable{

    /**
     * 
     */
    private static final long serialVersionUID = 5157302389107470742L;
    
    private Integer id;
    private String illness;
    private String duration;
    private Integer sex;
    private Date createTime;
    private Date modifyTime;
    private String levelOneSubject;
    private String levelTwoSubject;
    private String author;
    private String assistantExam;
    private String pathogen;
    private String scheme;
    private String medicine;
    private Integer warning;
    
    private String limitSymptoms;
    private Integer limitNum;
    
    private Set<Symptom> symptoms = new HashSet<Symptom>(0);
/*    private Set<Parts> partss = new HashSet<Parts>(0);*/
    private Set<AgeSelect> ages = new HashSet<AgeSelect>(0);
    private Set<Duration> durations = new HashSet<Duration>(0);
    
    @Id
    @Column(name="id",unique=true,nullable=false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    @Column(name="illness",nullable=false,length=30)
    public String getIllness() {
        return illness;
    }
    
    public void setIllness(String illness) {
        this.illness = illness;
    }

    @Column(name="duration")
    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    @Column(name = "sex")
    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "createTime", length = 19)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "modifyTime", length = 19)
    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    @Column(name="levelOneSubject")
    public String getLevelOneSubject() {
        return levelOneSubject;
    }

    public void setLevelOneSubject(String levelOneSubject) {
        this.levelOneSubject = levelOneSubject;
    }

    @Column(name="levelTwoSubject")
    public String getLevelTwoSubject() {
        return levelTwoSubject;
    }

    public void setLevelTwoSubject(String levelTwoSubject) {
        this.levelTwoSubject = levelTwoSubject;
    }

    @Column(name="author")
    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "illness")
    public Set<Symptom> getSymptoms() {
        return symptoms;
    }
    
    public void setSymptoms(Set<Symptom> symptoms) {
        this.symptoms = symptoms;
    }
    
/*    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "illness")
    public Set<Parts> getPartss() {
        return partss;
    }
    
    public void setPartss(Set<Parts> partss) {
        this.partss = partss;
    }*/
    
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "illness")
    public Set<AgeSelect> getAges() {
        return ages;
    }

    public void setAges(Set<AgeSelect> ages) {
        this.ages = ages;
    }
    
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "illness")
    public Set<Duration> getDurations() {
        return durations;
    }

    public void setDurations(Set<Duration> durations) {
        this.durations = durations;
    }

    @Column(name="assistantExam")
    public String getAssistantExam() {
        return assistantExam;
    }

    public void setAssistantExam(String assistantExam) {
        this.assistantExam = assistantExam;
    }

    @Column(name="pathogen")
    public String getPathogen() {
        return pathogen;
    }

    public void setPathogen(String pathogen) {
        this.pathogen = pathogen;
    }

    @Column(name="scheme")
    public String getScheme() {
        return scheme;
    }

    public void setScheme(String scheme) {
        this.scheme = scheme;
    }

    @Column(name="medicine")
    public String getMedicine() {
        return medicine;
    }

    public void setMedicine(String medicine) {
        this.medicine = medicine;
    }

    @Column(name="warning")
    public Integer getWarning() {
        return warning;
    }

    public void setWarning(Integer warning) {
        this.warning = warning;
    }

    @Column(name="limitSymptoms")
    public String getLimitSymptoms() {
        return limitSymptoms;
    }

    public void setLimitSymptoms(String limitSymptoms) {
        this.limitSymptoms = limitSymptoms;
    }

    @Column(name="limitNum")
    public Integer getLimitNum() {
        return limitNum;
    }

    public void setLimitNum(Integer limitNum) {
        this.limitNum = limitNum;
    }
    
}
